<template>
  <c-title title="客户档案信息">
    <QupList :column="3" sep="：" default-value="" label-position="right" label-width="130">
      <QupListItem label="所属组织" :value="customerDetailDTO.organizationName" />
      <QupListItem label="客户一级分类">
        <c-mdm-view :value="customerDetailDTO.oneCategoryCode" :label="customerDetailDTO.oneCategoryName" doc-code="QY023" />
      </QupListItem>
      <QupListItem label="客户二级分类">
        <c-mdm-view :value="customerDetailDTO.twoCategoryCode" :label="customerDetailDTO.twoCategoryName" doc-code="QY024" />
      </QupListItem>
      <QupListItem label="客户名称" :value="customerDetailDTO.name" />
      <QupListItem label="客户编码" :value="customerDetailDTO.code" />
      <QupListItem label="简称" :value="customerDetailDTO.customerAbbr" />
      <QupListItem label="所属国别" :value="customerDetailDTO.countryName" />
      <QupListItem label="经销商姓名" :value="customerDetailDTO.contactName" />
      <QupListItem label="经销商身份证号码" :value="customerDetailDTO.credentialNo" />
      <QupListItem label="关联零售商家" :value="customerDetailDTO.associatedDealerName" />
      <QupListItem label="关联零售商家编码" :value="customerDetailDTO.associatedDealerCode" />
      <QupListItem label="经营范围" :value="customerDetailDTO.businessScope" />
      <QupListItem label="合作起始日期" :value="$trimHMS(customerDetailDTO.cooperateStart)" />
      <QupListItem label="账号状态">
        <c-mdm-view :value="customerDetailDTO.businessStatus" :label="customerDetailDTO.businessStatusName" doc-code="SLCM027" />
      </QupListItem>
      <QupListItem label="是否电商配送" :value="customerDetailDTO.isElecBusiniess" dict-type-code="BOOLEANS" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="预停用时间" :value="customerDetailDTO.preShutdownTime" />
      <QupListItem label="市场层级" :value="customerDetailDTO.marketLevel || customerDetailDTO.marketLevelName" dict-type-code="MARKET_LEVEL" :prop-enum="{domainCode:'marketing',appCode:'slm'}" />
      <QupListItem label="客户所辖城市级别" :value="customerDetailDTO.cityLevelName" />
      <QupListItem label="客户类型" :value="customerDetailDTO.accountTypeName" />
      <QupListItem label="上级经销商" :value="customerDetailDTO.parentName" />
      <QupListItem label="装企总经销" :value="customerDetailDTO.decorateEnterpriseParentName" />
      <QupListItem label="上级经销商账号状态" :value="customerDetailDTO.parentBusinessStatusName" />
      <QupListItem label="客户经营类型" :value="customerDetailDTO.businessTypeName" />
      <QupListItem label="客户经营总面积" :value="`${customerDetailDTO.operateArea || 0}m²`" />
      <!-- <QupListItem label="启用状态" :value="[1,'1'].includes(customerDetailDTO.status)?'启用':'停用'" /> -->
      <QupListItem label="创建人" :value="customerDetailDTO.creator || customerDetailDTO.createBy" />
      <QupListItem label="创建时间" :value="customerDetailDTO.creationTime" />
    </QupList>
  </c-title>
</template>
<script>
export default {
  name: 'CustomerArchiveBaseInfo',
  props: {
    detail: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
    }
  },
  computed: {
    customerDetailDTO() {
      return this.detail.customerDetailDTO || {}
    },
    accountDTOS() {
      return this.detail.accountDTOS || []
    }
  },
  methods: {
    getAccountDTOField(key) {
      const t = this.accountDTOS.find(e => e[key] !== undefined && e[key] !== null)
      return t ? t[key] : ''
    }
  }
}
</script>
